﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml;
using System.Text;

public partial class apps_ahmhress_pages_AHMHRESSF03 : System.Web.UI.Page
{
    string vappid = "AHMHRESS";
    string vformid = "AHMHRESS_AHMHRESSF03";

    protected void Page_Load(object sender, EventArgs e)
    {
        formHeader.InnerHtml = AHMIDEAFunctions.GetFormHeader(vappid, vformid);
        AHMIDEAIdentity id = (AHMIDEAIdentity)User.Identity;

        try
        {
            string res = "";
            s0008.AHMMWSahmmwspub tst = new s0008.AHMMWSahmmwspub();
            res = tst.ahmwemtest01("<dataReq><row><vnrp>" + id.Nrp + "</vnrp></row></dataReq>");

            XmlDocument xdoc = new XmlDocument();
            xdoc.LoadXml(res);
            XmlNodeList lst = xdoc.SelectNodes("//details/dtl");

            StringBuilder sb = new StringBuilder("<ul>");
            foreach (XmlNode item in lst)
            {
                sb.Append("<li>" + item.SelectSingleNode("leavename").InnerText + " : " + item.SelectSingleNode("leavestock").InnerText + "</li>");

            }
            sb.Append("</ul>");

            ahmhressf03_data.InnerHtml = sb.ToString();
            //errorBlock.InnerHtml = "Response : " + res;
        }
        catch { }
    }
}